﻿<%@ Page Language="C#" MasterPageFile="~/WebLicenseMain.Master" AutoEventWireup="true" CodeBehind="SearchLicenses.aspx.cs" Inherits="WebLicenseGenerator.SearchLicenses" Title="Sinacor Licenciamento - Consultar Licenças" %>
<%@ Register Src="UC/DatePicker.ascx" TagName="DatePicker" TagPrefix="UC" %>
<%@ Register Src="UC/MaskedCNPJ.ascx" TagName="CNPJ" TagPrefix="UC" %>
<%@ Register Src="UC/WaitingProcess.ascx" TagName="WaitingProcess" TagPrefix="UC" %>
<%@ Register Src="UC/ClearForm.ascx" TagName="ClearForm" TagPrefix="UC" %>
<%@ Register Src="UC/Int32TextBox.ascx" TagName="Int32TextBox" TagPrefix="UC" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server" ></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="pagePath" runat="server">Sinacor Licenciamento / Consultar Licenças</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="pageTitle" runat="server"><h1>CONSULTAR LICENÇAS</h1></asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="pageBody" runat="server">
	<p>
		<table>
			<tr>
				<td class="labels">Aliase&nbsp;Cadastrados:</td>
				<td colspan="2"><asp:DropDownList ID="cbAliases" runat="server" AutoPostBack="false" /></td>
			</tr>
			<tr>
				<td class="labels">Data&nbsp;Criação</td>
				<td>
					<UC:DatePicker ID="dpStartDate" runat="server" ValidateEmptyDate="false" AutoPostBack="false" />
				</td>
			</tr>
			<tr>
				<td class="labels" style="height: 22px">Tipo&nbsp;Licença</td>
				<td><asp:DropDownList ID="cbLicenseType" runat="server" /></td>
			</tr>
			<tr>
				<td class="labels">ID&nbsp;Licença</td>
				<td>
					<table cellpadding="0" cellspacing="0">
						<tr>
							<td width="99%"><UC:Int32TextBox ID="txtLicenseId" runat="server" Style="width: 50px" CssClass="textboxform" ValidateEmptyText="false" /></td>
							<td width="1%" align="right"><asp:Button ID="btSearch" runat="server" Text="Pesquisar" CssClass="button" OnClick="btSearch_Click" CausesValidation="false" /></td>
							<td width="1%" align="right"><UC:ClearForm ID="btReset" runat="server" style="margin-left: 4px" /></td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</p>
	<fieldset class="tabela" style="width: 950px; height: 360px">
		<p>LICENÇAS</p>
		<asp:UpdatePanel ID="upModulos" runat="server">
			<Triggers>
				<asp:AsyncPostBackTrigger ControlID="btSearch" EventName="Click" />
			</Triggers>
			<ContentTemplate>
				<div style="position: relative">
					<asp:UpdateProgress ID="upBar" runat="server" DisplayAfter="100">
						<ProgressTemplate>
							<UC:WaitingProcess ID="waitProcessProgressBar" runat="server" />
						</ProgressTemplate>
					</asp:UpdateProgress>
					<div style="height: 300px; overflow: auto;">
						<asp:GridView ID="gvLicenses" runat="server" Width="95%" 
                            AutoGenerateColumns="false" onrowcommand="gvLicenses_RowCommand1">
							<HeaderStyle CssClass="Freezing" />
							<Columns>
								<asp:BoundField DataField="Id" HeaderText="Id Licença" HeaderStyle-BackColor="#666666"
									HeaderStyle-ForeColor="White" HeaderStyle-BorderWidth="1px" HeaderStyle-BorderColor="#CCCCCC"
									ItemStyle-BackColor="White" ItemStyle-BorderWidth="1px" ItemStyle-BorderColor="#CCCCCC" />
								<asp:BoundField DataField="AliasName" HeaderText="Alias" HeaderStyle-BackColor="#666666"
									HeaderStyle-ForeColor="White" HeaderStyle-BorderWidth="1px" HeaderStyle-BorderColor="#CCCCCC"
									ItemStyle-BackColor="White" ItemStyle-BorderWidth="1px" ItemStyle-BorderColor="#CCCCCC" />
								<asp:BoundField DataField="Created" HeaderText="Data Criação" HeaderStyle-BackColor="#666666"
									HeaderStyle-ForeColor="White" HeaderStyle-BorderWidth="1px" HeaderStyle-BorderColor="#CCCCCC"
									ItemStyle-BackColor="White" ItemStyle-BorderWidth="1px" ItemStyle-BorderColor="#CCCCCC" />
								<asp:BoundField DataField="Active" HeaderText="Status" HeaderStyle-BackColor="#666666"
									HeaderStyle-ForeColor="White" HeaderStyle-BorderWidth="1px" HeaderStyle-BorderColor="#CCCCCC"
									ItemStyle-BackColor="White" ItemStyle-BorderWidth="1px" ItemStyle-BorderColor="#CCCCCC" />
								<asp:BoundField DataField="Treaty" HeaderText="Tipo Licença" HeaderStyle-BackColor="#666666"
									HeaderStyle-ForeColor="White" HeaderStyle-BorderWidth="1px" HeaderStyle-BorderColor="#CCCCCC"
									ItemStyle-BackColor="White" ItemStyle-BorderWidth="1px" ItemStyle-BorderColor="#CCCCCC" />
								<asp:TemplateField HeaderText="(*)" HeaderStyle-BackColor="#666666" HeaderStyle-ForeColor="White" HeaderStyle-BorderWidth="1px" HeaderStyle-BorderColor="#CCCCCC" ItemStyle-BackColor="White" ItemStyle-BorderWidth="1px" ItemStyle-BorderColor="#CCCCCC" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle">
									<ItemTemplate>
										<asp:Button ID="btSelectAlias" runat="server" ToolTip="Selecionar" CommandArgument='<%# Eval("ID") %>' CommandName="AliasSelected" Text="SEL" CausesValidation="false"/>
									</ItemTemplate>
									<HeaderStyle BackColor="#666666" BorderColor="#CCCCCC" BorderWidth="1px" ForeColor="White" />
										<ItemStyle BackColor="White" BorderColor="#CCCCCC" BorderWidth="1px" />
								</asp:TemplateField>	
							</Columns>
						</asp:GridView>
					</div>
				</div>
			</ContentTemplate>
		</asp:UpdatePanel>
	</fieldset>
</asp:Content>